<%@ page pageEncoding="UTF-8" %>
<script src="<c:url value='/resources/js/manage.js'/>"></script>
<c:import url="../../../template/layout.jsp" charEncoding="UTF-8">
  <c:param name="title" value="需求列表"/>
  <c:param name="body">

    <div class="content-title">需求列表
      <p>${message.msg}</p>
    </div>
    <div class="container"
         style="background-color:#DCEAF4; width:1300px; height:500px;border-radius: 0px 0px 0px 0px;">
      <c:if test="${message!=null}">
        <div class="alert alert-danger" role="alert">${message.msg}</div>
      </c:if>
      <p></p>

      <div class="col-sm-5 col-sm-offset-1">
        <form id="searchForm" method="get" action="/system/demand/list"
              name="complaint">
          <div class="input-group pull-left" style="margin-bottom:8px;">
            查询：<a class="btn btn-primary btn-xs" href="/system/demand/list?acceptResult=1">受理</a>
            <a class="btn btn-primary btn-xs" href="/system/demand/list?acceptResult=0">未受理</a>
          </div>
          <div class="input-group">
            <input id="pageNo" name="pageNo" type="hidden" value="${pager.pageNo}"/>
            <input id="pageSize" name="pageSize" type="hidden" value="${pager.pageSize}"/>


          </div>
        </form>
      </div>

      <div class="main-content">

        <table class="table">
          <thead>
          <tr>
            <th>需求类型</th>
            <th>房子类型</th>
            <th>城市</th>
            <th>县区</th>
            <th>镇</th>
            <th>期待价格</th>
            <th>面积</th>
            <th>需求时间</th>
            <th>操作</th>
          </tr>
          </thead>
          <tbody>
          <c:forEach items="${pager.list}" var="demand">
            <tr class="success">
              <td><c:if test="${demand.demandType == 1}"><span>买房</span></c:if>
                <c:if test="${demand.demandType == 0}"><span>租房</span></c:if>
              </td>
              <td>${demand.houseTypeName}</td>
              <td>${demand.houseCity}</td>
              <td>${demand.houseCounty}</td>
              <td>${demand.houseTown}</td>
              <td>${demand.housePrice}</td>
              <td>${demand.houseArea}</td>
              <td>${demand.demandTime}</td>
              <td>
                <c:if test="${demand.acceptResult == 1}">
                  <span class="btn btn-primary btn-xs">已受理于${demand.acceptTime}
                  </span>
                </c:if>
                <c:if test="${demand.acceptResult == 0}">
                  <a class="btn btn-primary btn-xs"
                     href="/system/demand/accept?id=${demand.id}">受理
                  </a>
                </c:if>
              </td>
            </tr>
          </c:forEach>
          </tbody>
        </table>
      </div>
      <div class="row">
        <div class="col-sm-12">
            ${pager}
        </div>
      </div>
    </div>
  </c:param>
</c:import>
